#ifndef CFRAMELESSWIDGETBASE_H
#define CFRAMELESSWIDGETBASE_H

#include <QWidget>
#include <QMouseEvent>

class CFrameLessWidgetBase : public QWidget
{
    Q_OBJECT
public:
    CFrameLessWidgetBase(QWidget *parent = nullptr);
    ~CFrameLessWidgetBase();
protected:
    //bool nativeEvent(const QByteArray &eventType, void *message, long *result);

    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
    void paintEvent(QPaintEvent *event) override;

private:
    int m_nBorderWidth = 5;
    QPoint m_dragPosition;
    bool m_isMousePressed;

    QPoint pLast;
    bool m_bPressed;
    QPoint clickPos;
    bool m_bresize=false;
signals:
};

#endif // CFRAMELESSWIDGETBASE_H
